<template>
  <div class="wrap">
    <el-card>
      <div slot="header">
        <span>客观题得分：{{ score }}</span>
      </div>
      <div class="item">
        <span class="desc">满分：{{ totalScore }}</span>
        <div class="content score">
          <span>结果：<span class="strong">{{ result }}</span></span>
        </div>
      </div>

      <div class="item">
        <span class="desc">错题所在主要科目、章节：</span>
        <div class="content">
          <el-table
            :data="items"
            border
            style="width: 100%">
            <el-table-column
              prop="subjectName"
              label="科目" />
            <el-table-column
              prop="chapterName"
              label="章节" />
            <el-table-column
              prop="subjectName"
              label="考点" />
            <el-table-column
              prop="falseQuestNum"
              label="错题数" />
          </el-table>
        </div>
      </div>

      <p class="strong">注：标记为猜题的试题计入错题统计，未作答试题不计入错题统计。</p>
      <p style="text-align: center"><router-link to="/"> <el-button type="primary">查看详细答案结果</el-button></router-link></p>
    </el-card>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      items: [],
      totalScore: 0,
      score: 0,
      result: ''
    }
  },
  mounted() {
    this.queryList()
  },
  methods: {
    queryList() {
      axios.get('/handPaper/result/55c1a04db3e845799cb573c711b978e8/b59637c617834a4583b37be58ac6d7f6').then(res => {
        if (res.success) {
          this.totalScore = res.totalScore
          this.score = res.score
          this.items = res.falseQuestChapterData
          this.result = res.result
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  .wrap {
    padding: 30px;
  }
  .item {
    display: flex;
    margin-bottom: 40px;
  }
  .desc {
    width: 220px;
  }

  .content {
    flex: 1;
  }

  .strong {
    color: #F56C6C;
  }

  .score {
    display: flex;
    > span {
      flex: 1;
      line-height: 48px;
      text-align: center;
      outline: 1px solid #eee;
    }
  }
</style>
